Skip to content

fix(eth): properly return vm error in all gas estimation methods#13389

Merged
rvagg merged 1 commit into
masterfrom
rvagg/ethreverts
Oct 15, 2025
Merged

fix(eth): properly return vm error in all gas estimation methods#13389
rvagg merged 1 commit into
masterfrom
rvagg/ethreverts

Conversation

@rvagg
Copy link
Copy Markdown
Member

@rvagg rvagg commented Oct 15, 2025

I realised this is why we don't have consistent output on reverts, sometimes we get the vm error and sometimes not.

Same failure case, slightly different pathways:

failed to estimate gas: failed to estimate gas: message execution failed: exit 33, reason: message failed with backtrace:
00: f0169791 (method 3844450837) -- contract reverted at 75 (33)
01: f0169791 (method 6) -- contract reverted at 4535 (33)
02: f0169800 (method 3844450837) -- contract reverted at 75 (33)
03: f0169800 (method 6) -- contract reverted at 18957 (33)
 (RetCode=33)
failed to estimate gas: message execution failed (exit=[33], revert reason=[message failed with backtrace:
00: f0169791 (method 3844450837) -- contract reverted at 75 (33)
01: f0169791 (method 6) -- contract reverted at 4535 (33)
02: f0169800 (method 3844450837) -- contract reverted at 75 (33)
03: f0169800 (method 6) -- contract reverted at 18957 (33)
 (RetCode=33)], vm error=[0x42d750dc0000000000000000000000000542c82a785fab8b53c7c59aaad7093d87265f3a0000000000000000000000009050bdd028ba54a01777cd8c6d0a59d5bc52fdbf])

@rvagg rvagg requested review from Copilot and wjmelements October 15, 2025 03:58
@github-project-automation github-project-automation Bot moved this to 📌 Triage in FilOz Oct 15, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR standardizes error handling across gas estimation methods to ensure consistent output of VM errors during reverts. The change addresses inconsistencies where some gas estimation paths returned full error details including VM errors while others only returned basic execution failure messages.

  • Introduces a new centralized error creation function NewErrExecutionRevertedFromResult
  • Moves Ethereum revert parsing logic to a more appropriate location in the ethtypes package
  • Updates all gas estimation methods to use the standardized error format

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
node/impl/gasutils/gasutils.go Updated to use standardized error creation for consistent VM error reporting
node/impl/eth/gas.go Replaced custom error handling with centralized error creation function
node/impl/eth/utils.go Removed duplicate Ethereum revert parsing logic
chain/types/ethtypes/eth_types.go Added exported ParseEthRevert function with proper documentation
api/api_errors.go Added NewErrExecutionRevertedFromResult helper function for consistent error creation
CHANGELOG.md Added entry documenting the fix

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread chain/types/ethtypes/eth_types.go
@github-project-automation github-project-automation Bot moved this from 📌 Triage to ✔️ Approved by reviewer in FilOz Oct 15, 2025
@rvagg rvagg merged commit cbed4c2 into master Oct 15, 2025
103 checks passed
@rvagg rvagg deleted the rvagg/ethreverts branch October 15, 2025 05:09
@github-project-automation github-project-automation Bot moved this from ✔️ Approved by reviewer to 🎉 Done in FilOz Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: 🎉 Done

Development

Successfully merging this pull request may close these issues.

3 participants